package com.dognessnetwork.operation.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.dognessnetwork.operation.baseservice.DeviceVersionService;
import com.dognessnetwork.operation.dognecklace.domain.DeviceVersion;

@RestController
@RequestMapping(value="/deviceversion")
public class DeviceVersionJsonController {

	private @Autowired DeviceVersionService deviceVersionService;
	
	@PostMapping(value="/save")
	public DeviceVersion save(DeviceVersion deviceVersion) {
		
		DeviceVersion DeviceVersion = deviceVersionService.save(deviceVersion);
		return DeviceVersion;
	}
	
	@PostMapping(value="/delete_by_id")
	public void deleteById(Long id) {
		
		deviceVersionService.deleteById(id);
	}
	
	@PostMapping(value="/find_by_id")
	public DeviceVersion findById(Long id) {
		DeviceVersion deviceTestInfo = deviceVersionService.findById(id);
		return deviceTestInfo;
	}

}
